//解压缩ajax
document.querySelector("#demo2").addEventListener("click", function () {
    let a = $("#demo").val();
    let b = $("#demo1").val();
    let json = { "function": "unzip", "filePath": a, "targetPath": b };
    if (a == "" || b == "") {
        alert("请填写完整所有输入框")
    } else {
        $.ajax({
            url: 'http://127.0.0.1:8090/json/unzip.json',
            type: 'GET',
            dataType: 'json',
            data: json,
            cache: false,
            success: function (dat) {
                    viewMessage2(json);
                    returnColumn2(dat);
            },
            error: function () {
                alert('服务器超时，请重试！');
            }
        });
    }
})
//压缩ajax
document.querySelector("#formal3").addEventListener("click", function () {
    let a = $("#formal").val();
    let b = $("#formal2").val();
    let c = $("#formal7").val();
    if (a == "" || b == "" || c == "") {
        alert("请填写完整所有输入框")
    } else {
        let json = { "function": "zip", "filePath": a, "targetPath": b, "format": c };
        $.ajax({
            url: 'http://127.0.0.1:8090/json/zip.json',
            type: 'GET',
            dataType: 'json',
            date: json,
            cache: false,
            success: function (dat) {
                if (json.name == "" || json.formate == "") {
                    alert("请输入完整输入框")
                } else {
                    viewMessage(json);
                    returnColumn(dat);
                }
            },
            error: function () {
                alert('服务器超时，请重试！');
            }
        });
    }
})
